package com.cms.common.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import java.util.UUID;

/**
 * 角色
 */
@Data
@Entity
public class AdminUser extends BaseEntity {
    private String name;
    private String username;
    @JsonIgnore
    private String password;
    private String salt;
    private String uuid = UUID.randomUUID().toString();

    @OneToOne(targetEntity = Roles.class)
    @JoinColumn(name = "role_id",referencedColumnName = "id")
    private Roles roles = null;//

    @OneToOne(targetEntity = UploadFile.class)
    @JoinColumn(name = "file_md5",referencedColumnName = "md5")
    private UploadFile photo = null;//
}
